package com.fs.m.server.function.test;

import com.fs.m.server.domain.Result;
import com.fs.m.server.domain.ResultCode;
import com.fs.m.server.function.Function;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: zhuguoyin
 * Date: 13-10-7
 * Time: 下午2:33
 * To change this template use File | Settings | File Templates.
 */
public class VersionFunction1 implements Function {
    @Override
    public Result execute() throws Exception {
        Result result = new Result();
        result.setCode(ResultCode.SUCCESS.getCode());
        Map data = new HashMap();
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("client", "iphone");
        map.put("version", "1.0.1");
        map.put("changes", "修正了一些bug");
        map.put("releaseDate", new Date());
        map.put("parentVersion", "1.0.0");
        map.put("size", 1120);
        map.put("url", "http://www.baidu.com");
        data.put("hasNewVersion", "true");
        data.put("newVersion", map);
        result.setData(data);
        return result;
    }
}
